package com.zl.easybuy.util;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class ShoppingCart {
    private List<CartItem> items=new ArrayList<>();
    public double getSum(){
        double sum=0;
        for (CartItem cartItem:items){
            sum+=cartItem.getCost();
        }
        return sum;
    }
}
